export class PlaceWayEnum {
  #code
  #name
  get code(){
    return this.#code
  }

  get name(){
    return this.#name
  }

  constructor(code,name) {
    this.#code = code
    this.#name = name
  }
}

export const PlaceWays = Object.freeze({
    /**
     * 悬挂
     */
    HANG: new PlaceWayEnum(1,"悬挂"),
    /**
     * 落地
     */
    FALL: new PlaceWayEnum(2,"落地"),

    CONTIGUOUS : new PlaceWayEnum(3,"邻接"),

    SUSPEND_IN_AIR : new PlaceWayEnum(4,"悬浮"),

    valueOf : (code)=>{
      switch (code){
        case 1 : return this.HANG
        case 2 : return this.FALL
        case 3 : return this.CONTIGUOUS
        case 4 : return this.SUSPEND_IN_AIR
        default : return null
      }
    }
  }
)

export class GoodsTypeEnum {
  #code
  #name
  get code(){
    return this.#code
  }

  get name(){
    return this.#name
  }

  constructor(code,name) {
    this.#code = code
    this.#name = name
  }
}

export const GoodsTypes = Object.freeze({
  EQUIPMENT : new GoodsTypeEnum(1,"装备"),
  CUBE : new GoodsTypeEnum(2,"物块"),
  LIGHT : new GoodsTypeEnum(3,"光源"),
  valueOf :(code)=>{
    switch (code){
      case 1 : return this.EQUIPMENT
      case 2 : return this.CUBE
      case 3 : return this.LIGHT
      default : return null
    }
  }
})